
#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"

// set NOISY_TEST to 0 to remove printfs from output
#define NOISY_TEST 1

int main() {
    int i;
    int seed = 1000;
    int numPlayer = 2;
    int r;
    int k[10] = {adventurer, council_room, feast, gardens, mine
               , remodel, smithy, village, baron, great_hall};
    struct gameState G;
    int result;
    int loopCount = 10;
    int card = province;
    int check;
    
#if (NOISY_TEST == 1)
    printf ("TESTING isGameOver():\n"); // testing if game is over when province pile is at 0
#endif

    for (i = 0; i < loopCount; i++){
    

                memset(&G, 23, sizeof(struct gameState));   // clear the game state
                r = initializeGame(numPlayer, k, seed, &G); // initialize a new game
                
                G.supplyCount[card] = 0;
                          
                check = isGameOver(&G);

#if (NOISY_TEST == 1)
                printf(" the supplyCount of curse cards = %d, expected = %d\n", check, 1);
#endif
                assert(check == 1); // check if the number of curse cards in supplyCount is correct

}
    printf("All tests passed!\n");

    return 0;
}
